<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>完善信息</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">

	<script type="text/javascript" src="<%=basePath%>JS/jquery-ui-1.11.2/external/jquery/jquery.js"></script>
	<script type="text/javascript" src="<%=basePath%>JS/jquery-ui-1.11.2/jquery-ui.js"></script>
	<script type="text/javascript" src="<%=basePath%>JS/jquery-validation-1.13.1/dist/jquery.validate.js"></script>
	<script type="text/javascript" src="<%=basePath%>JS/WongDatePicker.js"></script>
	<link rel="stylesheet" type="text/css" href="<%=basePath%>JS/jquery-ui-1.11.2/jquery-ui.css">
	<link rel="stylesheet" type="text/css" href="<%=basePath%>CSS/style.css">
	<link rel="stylesheet" type="text/css" href="<%=basePath%>CSS/member.css">
	<link rel="stylesheet" type="text/css" href="<%=basePath%>JS/jquery-validation-1.13.1/demo/css/screen.css">
	
	<script>
//	$.validator.setDefaults({
//		submitHandler: function() {
//			from.submit();
//		}
//	});
		$(function(){
			alert("请完善个人详细信息！");
			var date = new Date();
			var year = date.getFullYear();
			var d= date.getFullYear()+"-"+date.getMonth()+"-"+date.getDay();
			$("#indate").val(year);
		//	$("#borth").datepicker({
		//		format:"YY-mm-dd",
		//		date: $("#borth").val(),
		//		current: $("#borth").val(),
		//		starts: 1,
		//		position: "r",
		//		onBeforeShow: function(){$("#borth").DatePickerSetDate($("#borth").val(), true);},
		//		onChange: function(formated, dates){$("#borth").val(formated);}
		//		});
			
			$("#password2").blur(function(){
				if($("#password2").val()!=$("#password").val()){
					alert("请输入一致的密码！");
					$("#password2").val("");
					$("#password2").fucus();
				}else{
				//	alert($("#password2").val());
				}
			});
				
			$("#userform").validate({
  			 	rules:{
  			 		number:"required",
  			 		password:{required:true,minlength:6},
  			 		password2:"required",
  			 		name:"required",
  			 		borth:{required:true,dateISO:true},
  			 		homeaddr:"required",
  			 		indate:{required:true,digits:true},
  			 		shschool:"required",
  			 		email:{
  			 			required: true,
  			 			email: true
  			 		}			 		
  			 	},
  			 	messages:{
  			 		number:"请输入用户名",
  			 		password:{required:"请更改新密码",minlength:"密码不少于六位"},
  			 		password2:"请输入确认密码",
  			 		name:"请输入姓名",
  			 		borth:{required:"请输入出生日期",dateISO:"请输入正确日期格式"},
  			 		homeaddr:"请输入家乡地址",
  			 		indate:{required:"请输入入学年份",digits:"请输入正确年份"},
  			 		shschool:"请输入毕业高中",
  			 		email:{
  			 			required: "请输入Email地址",
  			 			email:"请输入正确的Email地址"
  			 		}	
  			 	}
  			 });
		});
	</script>
	
  </head>
  
  <body>
   	<div id="head-search">
   	 	<span class="home-path"></span>
   	 	<span class="path-font">会员信息管理&nbsp;&nbsp;>>&nbsp;&nbsp;完善个人信息 </span>	
  		<button style="float:right" class="wong-button-text-ui wong-button-blue" onclick="javascrit:$('#userform').submit();">
   			<span class="wong-ui-icon wong-icon-save"></span>
   			<span >保存</span>
   		</button>	
   	</div>
   	<div class="memberbody">
   	<form id="userform" action="<%=basePath%>improveMemberAction" method="post">
   		<div class="memberleft">
   			<div class="divrow">	用&nbsp;户&nbsp;名:<input  name="number" id="number" value="${name}"/></div>
  	    	<div class="divrow">	新&nbsp;密&nbsp;码:<input type="password" name="password" id="password" /></div>
  	   		<div class="divrow">	确认密码:<input type="password" name="password2" id="password2" /></div>
  	    	<div class="divrow">	姓&nbsp;&nbsp;&nbsp;&nbsp;名:<input  name="name" id="name" value="${sessionScope.memname}"/></div>
  			<div class="divrow">	性&nbsp;&nbsp;&nbsp;&nbsp;别:<input type="radio" name="sex" id="sex"  value="男" checked>男&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="sex" id="sex"  value="女" >女</div>
			<div class="divrow">	出生年月:<input id="borth" name="borth" type="text" onfocus="setday(this,'yyyy-MM-dd','2010-01-01','2010-12-30',1)" readonly="readonly" /></div>		
  			<div class="divrow">	家乡地址:<input  name="homeaddr" id="homeaddr" /></div>
  			<div class="divrow">	入校年份:<input  name="indate" id="indate" /></div>
  			<div class="divrow">	毕业高中:<input  name="shschool" id="shschool" /></div>
  			<div class="divrow">	学&nbsp;&nbsp;&nbsp;&nbsp;院:<input  name="college" id="college" /></div>
  		</div>
  		<div class="memberright">
  			<div class="divrow">	专&nbsp;&nbsp;&nbsp;&nbsp;业:<input  name="major" id="major" /></div>
  			<div class="divrow">	学校住址:<input  name="schooladdr" id="schooladdr" /></div>
  			<div class="divrow">	联系电话:<input  name="phone" id="phone" /></div>
  			<div class="divrow">	短&nbsp;&nbsp;&nbsp;&nbsp;号:<input  name="cornet" id="cornet" /></div>
  			<div class="divrow">	邮&nbsp;&nbsp;&nbsp;&nbsp;箱:<input  name="email" id="email" /></div>
  			<div class="divrow">	工作地点:<input  name="workaddr" id="workaddr" /></div>
  			<div class="divrow">	工作类型:<input  name="worktype" id="worktype" /></div>
  			<div class="divrow">	同乡职位:
  				<select name="position" id="position">
  					<option value="会员">会员</option>
  					<option value="会长">会长</option>
  					<option value="秘书长">秘书长</option>
  					<option value="组织委员">组织委员</option>
  					<option value="生活委员">生活委员</option>
  					<option value="外联委员">外联委员</option>
  					<option value="文娱委员">文娱委员</option>
  					<option value="宣传委员">宣传委员</option>
  				</select>
  			</div>
  		</div>
  		<div class="memberbottom">	个人简介:<textarea  name="detail" id="detail" cols="80" rows="6"></textarea></div>
  	
  	</form>
   	</div>
  </body>
  
</html>
